fix(omp): discover title-first session transcripts - #846
Conversation
Co-authored-by: openai/gpt-5.6-terra <noreply@openai.com>
iamtoruk
left a comment
There was a problem hiding this comment.
Fixes #845. Clean, well-scoped fix: readSessionEntry now scans the JSONL for the first type: "session" record (skipping blank lines, malformed JSON, and non-session metadata like OMP's type: "title" slot) instead of requiring it on the first physical line. Since readSessionFile reads the whole file up to its size cap, the scan reaches the header regardless of how many title/blank lines precede it, and oversize files were already skipped before this change, so there is no read-size regression.
No regression for Pi or ordinary OMP transcripts (session on line 1 is found immediately); files with no session record are still rejected. Mutation-checked: the new "discovers title-first sessions" test fails on main and passes with the fix; the other discovery cases pass both ways. On the merged tree (main was 37 ahead, clean): tsc clean, omp/pi provider suites 31/31, full suite green apart from the two pre-existing parser.test.ts failures (and a cache-refresh-lock heartbeat test that flakes under parallel load and passes in isolation, untouched by this change). Good to merge.
…), drop redundant type guard
…he all-provider view buildDurablePeriod derived the today slice of the multi-day, all-provider headline from the unsliced whole-range parse, so a turn spanning local midnight kept its category and turn count anchored on its yesterday start. The per-call cost and calls bucketed onto today correctly, but By Activity and the JSON daily turn count lost the post-midnight half — categories summed to only the pre-midnight cost while the headline, By Model and By Project were right. Slice the today parse with filterProjectsByDays first, which re-anchors the straddling turn to its surviving today calls, so today's category cost lands on today. Category cost is the sum of the slice's own calls, so day-N + day-N+1 still equals the whole-range total (no over-count); the per-day turn-count split matches the cache side and the documented per-day semantics. Adds a regression test in the straddling-turn conservation suite (mutation-checked: fails on the pre-fix code). Also fills in the CHANGELOG Unreleased entries for the batch (#853, #856, #872, #846/#859, #866/#867, #833).
Summary
Fixes #845 by changing shared Pi/OMP JSONL discovery to find the first
type: "session"record rather than requiring it on the first physical line.OMP may store mutable session titles as a fixed-width type: "title" record before the JSONL session header. CodeBurn previously rejected these otherwise valid transcripts before parsing.
Changes
Testing
npm testpassesnpm run buildsucceedsFor new providers only:
npm run dev -- todayshows correct costs and session counts for this providernpm run dev -- models --provider <name>shows correct model names and pricing